package Job02;

import java.util.Scanner;

public class Test {
    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        CustomerBiz customerBiz = new CustomerBiz();
        do {
            System.out.println("1.新增姓名");
            System.out.println("2.修改姓名");
            System.out.println("3.查找姓名");
            System.out.println("4.删除姓名");
            System.out.println("请选择:");
            int i = input.nextInt();
            switch (i){
                case 1:
                    System.out.println("请输入要新增的姓名:");
                    String name = input.next();
                    customerBiz.addName(name);
                    customerBiz.show01();
                    break;
                case 2:
                    System.out.println("修改客户:");
                    String name1 = input.next();
                    System.out.println("请输入要修改的姓名:");
                    String name2 = input.next();
                    customerBiz.updateName(name1,name2);
                    customerBiz.show01();
                    break;
                case 3:
                    System.out.println("请输入编号:");
                    int CZ1 = input.nextInt();
                    System.out.println("请输入:");
                    int CZ2 = input.nextInt();
                    System.out.println("请输入要查找的姓名:");
                    String names = input.next();
                    customerBiz.searchName(CZ1,CZ2,names);
                    customerBiz.show01();
                    break;
                case 4:
                    System.out.println("请输入要删除的姓名:");
                    name = input.next();
                    customerBiz.deleteName(name);
                    customerBiz.show01();
                    break;
                default:
                    break;
            }
        }while (true);
    }
}
